<!-- descriptions-->
<div id="collection-page" class="profile">
  <!-- /descriptions-->
  <!--subnavigation, sorting and actions-->
  <!--/subnav-->
  <!--main content-->
  <h3>
    <%=h t('.potential_match.view', :default => "Potential Match for %{requester}: %{offerer}", 
      :requester => @potential_match.request_signup.pseud.byline, :offerer => @potential_match.offer_signup.pseud.byline) %>
  </h3>

  <div class="collection meta">
    <h3>Summary</h3>
    <dl>
      <dt>Number of requests matched: </dt>
      <dd><%= @potential_match.num_prompts_matched %></dd>
    
      <% @potential_match.request_signup.requests.each_with_index do |request, index| %>
        <% request.potential_prompt_matches.select {|prompt_match| prompt_match.potential_match == @potential_match}.each do |prompt_match| %>
          <% TagSet::TAG_TYPES.each do |type| %>
            <% if (count = prompt_match.send("num_#{type.pluralize}_matched")) == PotentialPromptMatch::ALL || count > 0 %>
              <dt><%= "Request #{index+1} #{type.pluralize} matched:" %></dt> 
              <dd><%= count == PotentialPromptMatch::ALL ? "All" : count %></dd>
            <% end %>
          <% end %>
        <% end %>
      <% end %>
    </dl>
  </div>

  <div class="collection preface">
    <h3><%=h t("potential_matches.requests_for", :default => "Requests by %{requester}", :requester => @potential_match.request_signup.pseud.byline) %></h3>
    <%= render :partial => "challenge_signups/show_requests", :locals => {:challenge_signup => @potential_match.request_signup} %>
    
    <h3><%=h t("potential_matches.offers_for", :default => "Offers from %{offerer}", :offerer => @potential_match.offer_signup.pseud.byline) %></h3>
    <%= render :partial => "challenge_signups/show_offers", :locals => {:challenge_signup => @potential_match.offer_signup} %>
  </div>

  <!--/content-->
  
</div>

